import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * 
 * @author Taylor Holden
 *
 * WindowBuilderPro generated code. Main Menu UI.
 */

public class MainMenu extends JFrame {

	private JPanel contentPane;
	private boolean hasFinished;

	/**
	 * Create the frame.
	 */
	public MainMenu() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		hasFinished = false;
		setBounds(100, 100, 800, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("Oregon Trail");
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 24));
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setBounds(309, 163, 140, 77);
		contentPane.add(lblNewLabel);
		
		JLabel lblNewLabel_1 = new JLabel("1842 Zombie Apocalypse!");
		lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblNewLabel_1.setBounds(283, 232, 230, 38);
		contentPane.add(lblNewLabel_1);
		
		JButton btnNewGame = new JButton("New Game");
		btnNewGame.addActionListener(new NewGameButtonHandler());
		btnNewGame.setBounds(321, 319, 127, 23);
		contentPane.add(btnNewGame);
		
		JButton btnLoadGamecoming = new JButton("Load Game (coming soon!)");
		btnLoadGamecoming.setEnabled(false);
		btnLoadGamecoming.setBounds(283, 365, 216, 23);
		contentPane.add(btnLoadGamecoming);
	}

	/**
	 * Accessor for the hasFinished field.
	 * @return hasFinished boolean variable.
	 */
	public boolean hasFinished()
	{
		return hasFinished;
	}
	
	class NewGameButtonHandler implements ActionListener
	{
		@Override
		public void actionPerformed(ActionEvent arg0) 
		{
			hasFinished = true;
		}
	}
}
